package com.hfi.compositepattern.demo01;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ChangLiang
 * @date 2020/4/26
 */
public class Picture implements Shape {

    List<Shape> shapes = new ArrayList<>();

    @Override
    public void draw() {
        shapes.forEach((s)->s.draw());
    }

    public void add(Shape shape) {
        shapes.add(shape);
    }
}
